//
//  FoodOrderDetail.swift
//
//  Created by 邱仙凯 on 2021/9/22
//  Copyright (c) . All rights reserved.
//

import Foundation
import ObjectMapper

public struct ZyaFoodOrderDetail: Mappable {

  // MARK: Declaration for string constants to be used to decode and also serialize.
  private struct SerializationKeys {
    static let sAuxNumSh = "s_aux_num_sh"
    static let sCode = "s_code"
    static let sProduceInstoreAuxNum = "s_produce_instore_aux_num"
    static let sGoodsId = "s_goods_id"
    static let sNumSh = "s_num_sh"
    static let sNum = "s_num"
    static let sName = "s_name"
    static let sMoney = "s_money"
    static let sAuxNum = "s_aux_num"
    static let sPrice = "s_price"
    static let sStandard = "s_standard"
    static let idKey = "id_key"
    static let sSecUnitName = "s_sec_unit_name"
    static let sUnitName = "s_unit_name"
    static let sSaleUnit = "s_sale_unit"
    static let sTax = "s_tax"
    static let sRemark = "s_remark"
    static let sWeightSh = "s_weight_sh"
    static let sWeightRatio = "s_weight_ratio"
    static let sRawPig = "s_raw_pig"
    static let sSpec = "s_spec"
    static let sWeight = "s_weight"
    static let sVouId = "s_vou_id"
    static let sStatus = "s_status"
    static let sProduceInstoreNum = "s_produce_instore_num"
    static let sMoneyTax = "s_money_tax"
      static let sCompanyGoodsTreeNm = "s_company_goods_tree_nm"
  }

  // MARK: Properties
  public var sAuxNumSh: String?
  public var sCode: String?
  public var sProduceInstoreAuxNum: String?
  public var sGoodsId: String?
  public var sNumSh: String?
  public var sNum: String?
  public var sName: String?
  public var sMoney: String?
  public var sAuxNum: String?
  public var sPrice: String?
  public var sStandard: String?
  public var idKey: String?
  public var sSecUnitName: String?
  public var sUnitName: String?
  public var sSaleUnit: String?
  public var sTax: String?
  public var sRemark: String?
  public var sWeightSh: String?
  public var sWeightRatio: String?
  public var sRawPig: String?
  public var sSpec: String?
  public var sWeight: String?
  public var sVouId: String?
  public var sStatus: String?
  public var sProduceInstoreNum: String?
  public var sMoneyTax: String?
    public var sCompanyGoodsTreeNm: String?

  // MARK: ObjectMapper Initializers
  /// Map a JSON object to this class using ObjectMapper.
  ///
  /// - parameter map: A mapping from ObjectMapper.
  public init?(map: Map){

  }

  /// Map a JSON object to this class using ObjectMapper.
  ///
  /// - parameter map: A mapping from ObjectMapper.
  public mutating func mapping(map: Map) {
    sAuxNumSh <- map[SerializationKeys.sAuxNumSh]
    sCode <- (map[SerializationKeys.sCode],StringTransform())
    sProduceInstoreAuxNum <- map[SerializationKeys.sProduceInstoreAuxNum]
    sGoodsId <- (map[SerializationKeys.sGoodsId],StringTransform())
    sNumSh <- (map[SerializationKeys.sNumSh],StringTransform())
    sNum <- (map[SerializationKeys.sNum],StringTransform())
    sName <- map[SerializationKeys.sName]
    sMoney <- (map[SerializationKeys.sMoney],StringTransform_test())
    sAuxNum <- (map[SerializationKeys.sAuxNum],StringTransform())
    sPrice <- (map[SerializationKeys.sPrice],StringTransform_test())
    sStandard <- (map[SerializationKeys.sStandard],StringTransform())
    idKey <- (map[SerializationKeys.idKey],StringTransform())
    sSecUnitName <- map[SerializationKeys.sSecUnitName]
    sUnitName <- map[SerializationKeys.sUnitName]
    sSaleUnit <- (map[SerializationKeys.sSaleUnit],StringTransform())
    sTax <- (map[SerializationKeys.sTax],StringTransform())
    sRemark <- map[SerializationKeys.sRemark]
    sWeightSh <- map[SerializationKeys.sWeightSh]
    sWeightRatio <- map[SerializationKeys.sWeightRatio]
    sRawPig <- map[SerializationKeys.sRawPig]
    sSpec <- map[SerializationKeys.sSpec]
    sWeight <- (map[SerializationKeys.sWeight],StringTransform_test())
    sVouId <- (map[SerializationKeys.sVouId],StringTransform())
    sStatus <- (map[SerializationKeys.sStatus],StringTransform())
    sProduceInstoreNum <- map[SerializationKeys.sProduceInstoreNum]
    sMoneyTax <- map[SerializationKeys.sMoneyTax]
      sCompanyGoodsTreeNm <- (map[SerializationKeys.sCompanyGoodsTreeNm], StringTransform())
  }

  /// Generates description of the object in the form of a NSDictionary.
  ///
  /// - returns: A Key value pair containing all valid values in the object.
  public func dictionaryRepresentation() -> [String: Any] {
    var dictionary: [String: Any] = [:]
    if let value = sAuxNumSh { dictionary[SerializationKeys.sAuxNumSh] = value }
    if let value = sCode { dictionary[SerializationKeys.sCode] = value }
    if let value = sProduceInstoreAuxNum { dictionary[SerializationKeys.sProduceInstoreAuxNum] = value }
    if let value = sGoodsId { dictionary[SerializationKeys.sGoodsId] = value }
    if let value = sNumSh { dictionary[SerializationKeys.sNumSh] = value }
    if let value = sNum { dictionary[SerializationKeys.sNum] = value }
    if let value = sName { dictionary[SerializationKeys.sName] = value }
    if let value = sMoney { dictionary[SerializationKeys.sMoney] = value }
    if let value = sAuxNum { dictionary[SerializationKeys.sAuxNum] = value }
    if let value = sPrice { dictionary[SerializationKeys.sPrice] = value }
    if let value = sStandard { dictionary[SerializationKeys.sStandard] = value }
      if let value = idKey { dictionary[SerializationKeys.idKey] = value } else {
          dictionary[SerializationKeys.idKey] = ""
      }
    if let value = sSecUnitName { dictionary[SerializationKeys.sSecUnitName] = value }
    if let value = sUnitName { dictionary[SerializationKeys.sUnitName] = value }
      if let value = sSaleUnit { dictionary[SerializationKeys.sSaleUnit] = value } else {
          dictionary[SerializationKeys.sSaleUnit] = "1"
      }
      if let value = sTax { dictionary[SerializationKeys.sTax] = value } else {
          dictionary[SerializationKeys.sTax] = ""
      }
    if let value = sRemark { dictionary[SerializationKeys.sRemark] = value }
    if let value = sWeightSh { dictionary[SerializationKeys.sWeightSh] = value }
    if let value = sWeightRatio { dictionary[SerializationKeys.sWeightRatio] = value }
    if let value = sRawPig { dictionary[SerializationKeys.sRawPig] = value }
    if let value = sSpec { dictionary[SerializationKeys.sSpec] = value }
    if let value = sWeight { dictionary[SerializationKeys.sWeight] = value }
    if let value = sVouId { dictionary[SerializationKeys.sVouId] = value }
    if let value = sStatus { dictionary[SerializationKeys.sStatus] = value }
    if let value = sProduceInstoreNum { dictionary[SerializationKeys.sProduceInstoreNum] = value }
      if let value = sCompanyGoodsTreeNm { dictionary[SerializationKeys.sCompanyGoodsTreeNm] = value }
      if let value = sMoneyTax { dictionary[SerializationKeys.sMoneyTax] = value } else {
          dictionary[SerializationKeys.sMoneyTax] = ""
      }
    return dictionary
  }

}
